home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / macros / tip / toc-mac.tip < prev    next >
Text File  |  1993-09-15  |  1KB  |  58 lines

  1. % This macro source file is from the four volume series
  2. % "TeX in Practice" by Stephan von Bechtolsheim, published
  3. % 1993 by Springer-Verlag, New York.
  4. % Copyright 1993 Stephan von Bechtolsheim.
  5. % No warranty or liability is assumed.
  6. % This macro may be copied freely if no fees other than
  7. % media cost or shipping charges are charged and as long
  8. % as this copyright and the following source code itself
  9. % is not changed. Please see the series for further information.
  10. %
  11. % Version: 1.0
  12. % Date: May 1, 1993
  13. %
  14. %
  15. % This source code is documented in 12.4.1, p. II-122.
  16. % Original source in file "par3.TEX", starting line 797.
  17. \wlog{L: "toc-mac.tip" ["par3.TEX," l. 797, p. II-122]}%
  18. % This file DOES belong to format "texip."
  19. \catcode`\@ = 11
  20. \newcount\@GenTocEntryLevel
  21. \def\GenTocEntry #1#2#3#4{%
  22.     \par
  23.     \bgroup
  24.     \global\@GenTocEntryLevel = #1
  25.     \leftskip = #4
  26.     \parindent = #2
  27.     \advance\parindent by -#4
  28.     \dimen0 = #3
  29.     \advance\dimen0 by -#2
  30.     \@GenTocEntry
  31. }
  32. \def\@GenTocEntry #1#2#3#4#5#6#7#8{%
  33.     \rightskip = #1 plus 1in
  34.     \parfillskip = #2
  35.     \advance\parfillskip by -#1
  36.     #7
  37.     \ifdim #3 > 0pt
  38.         \setbox0 = \hbox to #3{\hfil.\hfil}
  39.     \else
  40.         \setbox0 = \box\voidb@x
  41.     \fi
  42.     \leavevmode
  43.     \hbox to \dimen0 {#5\hfil}%
  44.     {% 
  45.         #6% 
  46.         \unskip
  47.     }%
  48.     \ifvoid 0
  49.         \hfill
  50.     \else
  51.         \nobreak\leaders\copy0\hskip #4plus 1fil
  52.     \fi
  53.     #8%
  54.     \par
  55.     \egroup
  56. }
  57. \catcode`\@ = 12
  58.